﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                     xmlns:vm="clr-namespace:Inovout.SoftwareStudio.Gui.Wpf.ViewModels"
                    xmlns:ic="clr-namespace:Inovout.Gui.Wpf.Controls;assembly=Inovout.Gui.Wpf">

    <DataTemplate DataType="{x:Type vm:ProductCollectionViewModel}">
        <ic:XDataGrid ItemsSource="{Binding}">
            <DataGrid.Columns>
                <DataGridTextColumn Binding="{Binding Name, Mode=OneTime}" />
            </DataGrid.Columns>
        </ic:XDataGrid>
    </DataTemplate>

    <DataTemplate DataType="{x:Type vm:ProductViewModel}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <TextBox Grid.Row="0" Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,ValidatesOnExceptions=True, ValidatesOnDataErrors=True}" />
            <TextBox Grid.Row="1" Text="{Binding Summary,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged,ValidatesOnExceptions=True, ValidatesOnDataErrors=True}"/>
        </Grid>
    </DataTemplate>

</ResourceDictionary>